const {
    createProxyMiddleware
} = require('http-proxy-middleware');


module.exports = function(app) {
    app.use(createProxyMiddleware('/api1', {
        target: 'http://192.168.2.232:8856',
        /*上传图片的接口*/
        changeOrigin: true,
        ws: true,
        pathRewrite: {
            '^/api1': ''
        },
    }));
    app.use(createProxyMiddleware('/api2', {
        // 小龙接口
        target: 'http://192.168.2.232:8863/',
        /*这里写自己的代理地址*/
        changeOrigin: true,
        ws: true,
        pathRewrite: {
            '^/api2': ''
        },
    }));
    app.use(createProxyMiddleware('/api3', {
        /* 廖同学接口 */
        target: 'http://192.168.2.232:8881/',
        /*这里写自己的代理地址*/
        changeOrigin: true,
        ws: true,
        pathRewrite: {
            '^/api3': ''
        },
    }));
};